Skip to main content

sheet

Type

command

Summary

Displays a stack as a sheet dialog box.

Syntax

sheet <stack> [in <parentStack>]

Description

Use the sheet command to display a stack as a custom sheet.

The sheet command opens the stack as a sheet in the window of the specified parentStack. If you don't specify a parentStack, the sheet is displayed in the window of the defaultStack.

The stack's rectangle and location properties are ignored.

While a sheet dialog box is open, nothing else can be done in the stack the sheet is displayed in. Because of this, you should use sheets only when a stack must obtain feedback from the user before it can continue.

If the stack is already open, the sheet command closes the stack and reopens it as a sheet, so closeStack and openStack, closeCard and openCard, and (if applicable) closeBackground and openBackground messages are sent to the parentStack's current card as a result of executing this command. Use the lock messages command before executing modal if you want to prevent the close messages from being sent; the open messages are sent regardless of the setting of the lockMessages property.

The sheet command pauses the running handler until the sheet is dismissed (usually by clicking a button in the sheet). To return information to the handler about which button was clicked, in the button's script, set a global variable or custom property. After the dialog box is dismissed, the handler can query this variable or property and act accordingly.

Attempting to open a sheet from within another sheet displays the second stack as a modal dialog box instead.

Cross-platform note

The appearance of sheets on OS X, in which they slide into view from the title bar, is unique to that OS and does not happen on Windows or Linux. However, on all three OSes, dialogs opened with the sheet command will be window-modal, rather than application-modal. A window-modal dialog will block further interaction in the window being covered by the dialog, while allowing interaction in all others. In an application-modal window, interactions with all other windows are prevented until the dialog is dismissed.

Parameters

NameTypeDescription

stack

Any stack reference.

parentStack

Any open stack that is not being displayed as a sheet.

Examples

sheet stack "myFilePickerStack"
sheet me in stack "project1"

command: sheet, lock messages, ask, modeless

constant: return

glossary: sheet, variable, handler, property, modal dialog box, execute, dialog box, command, Windows, global, OS X, custom property, Unix, Mac OS, message, parameter, current card

keyword: rectangle, button

message: openCard, closeStack, closeCard, closeBackground, openStack, openBackground

object: stack, button

property: defaultStack, script, properties, location, lockMessages

Compatibility and Support

Introduced

LiveCode 2.0

OS

mac

windows

linux

Platforms

desktop

server

Thank you for your feedback!

Was this page helpful?